;; 测试 quote 表达式和 ' 语法糖
(display "===== 测试 quote 表达式 =====")
(newline)

(display "(quote (1 2 3)) => ")
(display (quote (1 2 3)))
(newline)

(display "'(1 2 3) => ")
(display '(1 2 3))
(newline)

(display "'hello => ")
(display 'hello)
(newline)

(display "'#t => ")
(display '#t)
(newline)

;; 测试列表操作函数
(display "\n===== 测试列表操作函数 =====")
(newline)

;; cons
(display "(cons 1 '()) => ")
(display (cons 1 '()))
(newline)

(display "(cons 1 (cons 2 '())) => ")
(display (cons 1 (cons 2 '())))
(newline)

(display "(cons 'a '(b c)) => ")
(display (cons 'a '(b c)))
(newline)

;; car 和 cdr
(display "(car '(1 2 3)) => ")
(display (car '(1 2 3)))
(newline)

(display "(cdr '(1 2 3)) => ")
(display (cdr '(1 2 3)))
(newline)

(display "(car (cdr '(1 2 3))) => ")
(display (car (cdr '(1 2 3))))
(newline)

;; list
(display "(list 1 2 3) => ")
(display (list 1 2 3))
(newline)

(display "(list 'a 'b 'c) => ")
(display (list 'a 'b 'c))
(newline)

(display "(list) => ")
(display (list))
(newline)

;; null? 和 pair?
(display "(null? '()) => ")
(display (null? '()))
(newline)

(display "(null? '(1 2)) => ")
(display (null? '(1 2)))
(newline)

(display "(pair? '()) => ")
(display (pair? '()))
(newline)

(display "(pair? '(1 2)) => ")
(display (pair? '(1 2)))
(newline)

(display "(pair? 5) => ")
(display (pair? 5))
(newline)

;; 测试对象同一性
(display "\n===== 测试对象同一性 =====")
(newline)

;; eq? 测试
(display "(eq? 'a 'a) => ")
(display (eq? 'a 'a))
(newline)

(display "(eq? '() '()) => ")
(display (eq? '() '()))
(newline)

;; 定义相同的符号，验证它们是同一个对象
(define a 'hello)
(define b 'hello)
(display "(eq? a b) => ")
(display (eq? a b))
(newline)

;; eqv? 测试
(display "(eqv? 5 5) => ")
(display (eqv? 5 5))
(newline)

(display "(eqv? #t #t) => ")
(display (eqv? #t #t))
(newline)

(display "(eqv? \"hello\" \"hello\") => ")
(display (eqv? "hello" "hello"))
(newline)

;; equal? 测试 - 基本类型
(display "(equal? 5 5) => ")
(display (equal? 5 5))
(newline)

(display "(equal? \"hello\" \"hello\") => ")
(display (equal? "hello" "hello"))
(newline)

;; equal? 测试 - 列表结构
(display "(equal? '(1 2 3) '(1 2 3)) => ")
(display (equal? '(1 2 3) '(1 2 3)))
(newline)

(display "(equal? '(1 (2 3)) '(1 (2 3))) => ")
(display (equal? '(1 (2 3)) '(1 (2 3))))
(newline)

;; 测试复杂嵌套列表
(display "\n===== 测试复杂嵌套列表 =====")
(newline)

(define nested-list '(1 (2 (3 4) 5) 6))
(display "嵌套列表: ")
(display nested-list)
(newline)

(display "(car nested-list) => ")
(display (car nested-list))
(newline)

(display "(car (cdr nested-list)) => ")
(display (car (cdr nested-list)))
(newline)

(display "(car (car (cdr nested-list))) => ")
(display (car (car (cdr nested-list))))
(newline)

(display "\n所有测试完成！")
(newline)